package org.xx.armory.http;

import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

/**
 * 授信管理器, 此管理器实际不对证书进行任何检验, 使用此管理器不需要安装或者设置证书
 *
 * @author Haart
 */
final class IgnoreCertTrustManager
        implements X509TrustManager {

    /**
     * {@inheritDoc}
     */
    @Override
    public void checkClientTrusted(
            X509Certificate[] chain,
            String authType
    )
            throws CertificateException {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void checkServerTrusted(
            X509Certificate[] chain,
            String authType
    )
            throws CertificateException {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public X509Certificate[] getAcceptedIssuers() {
        return null;
    }

}
